package com.mate.cloud.config;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.mate.cloud.core.jackson.MateJavaTimeModule;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ManualJacksonConfig {

    @Bean
    @ConditionalOnMissingBean(ObjectMapper.class)
    public ObjectMapper objectMapper() {
        ObjectMapper mapper = new ObjectMapper();
        mapper.registerModule(new MateJavaTimeModule());
        return mapper;
    }
}
